import { Table } from "antd";
import React from "react";

function ListTable({ columns, dataSource, loading, total, pageSize, pageChange }) {
    return (
        <Table
            rowKey="id"
            loading={loading}
            dataSource={dataSource}
            columns={columns}
            pagination={
                {
                    total: total,
                    pageSize: pageSize,
                    onChange(p, ps) { 
                        pageChange(p, ps)
                    },
                }
            }
        />
    );
}

export default React.memo(ListTable);
